package com.service.impl;

import com.dao.IAccountDao;
import com.service.IAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;

/**
 * 项目名称：Spring21
 * 类 名 称：AccountServiceImpl
 * 类 描 述：账户的业务层实现类
 * 创建时间：2020-01-04 22:04
 */
@Service("accountService")
@Scope("singleton")
public class AccountServiceImpl implements IAccountService {
    //@Autowired
    @Resource(name = "accountDao1")
    private IAccountDao accountDao;

    public void saveAccount() {
        accountDao.saveAccount();
    }

    @PostConstruct
    public void init() {
        System.out.println("初始化方法执行了");
    }

    @PreDestroy
    public void destroy() {
        System.out.println("销毁方法执行了");
    }
}
